<%--
  Created by IntelliJ IDEA.
  User: gezhangkai
  Date: 2017/3/30 0030
  Time: 16:58
  To change this template use File | Settings | File Templates.
--%>
<%--
  Created by IntelliJ IDEA.
  User: gezhangkai
  Date: 2016/10/12 0012
  Time: 15:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/includes/taglibs.jsp" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
  <script type="text/javascript" src="/scripts/manage/administrator_list.js"></script>
  <script type="text/javascript" src="/scripts/thirdplugin/jquery.ajaxfileupload.js"></script>
  <script type="text/javascript" src="/scripts/thirdplugin/uploadify/jquery.uploadify.min.js"></script>

  <title></title>
</head>
<body style="height:100%;width:100%;">
<div class="easyui-panel" fit="true">
  <form id="batchUpdateForm"><input type="file" id="batchUpdateFile" name="file" style="display: none"/></form>
  <form id="batchAddForm">
    <input type="file" name="file" id="batchAddFile" style="display: none"/>
  </form>


  <div id="divQuery" style="height: 8%;min-height: 30px;margin-top: 15px;">
    <form id="formQuery">
      <div style="width: 100%; margin-left: auto; margin-right: auto;">
        <table id="tblQuery">
          <tr>
            <td style="width: 30px;text-align: right">ID</td>
            <td><input class="easyui-validatebox textbox" id="qryId" type="text"
                       name="id" missingMessage="输入ID"
                       data-options="required:false,validType:'integer'" style="width: 160px"/></td>
            <td style="width: 30px;text-align: right">名称</td>
            <td><input class="easyui-validatebox textbox" id="qryName" type="text"
                       name="name" missingMessage="输入名称" style="width: 160px"
                       data-options="required:false"/></td>
            <%--<td style="width: 30px;text-align: right">注册时间</td>--%>
            <%--<td><></td>--%>
            <td><input class="easyui-linkbutton" type="button" onclick="queryData()" value="查询"
                       style="width:80px;"></td>
            <td><input class="easyui-linkbutton" type="button" onclick="clearQuery()" value="清空"
                       style="width:80px;"></td>
          </tr>
        </table>
      </div>
    </form>
  </div>
  <div style="height:87%;margin-top:10px">
    <div style="height: 5%;min-height: 25px">
      <table>
        <tr>
          <td>
            <select id="singleSelect" class="easyui-combobox" style="width: 60px"
                    data-options="onChange:function(){$('#infoDatagrid').datagrid({singleSelect:$('#singleSelect').combobox('getValue')==0});}">
              <option value="1">多选</option>
              <option value="0">单选</option>
            </select>
          </td>
        </tr>
      </table>

    </div>
    <div id="iosVideoInfo" style="width:100%;height:95%">
      <table style="width:100%;height: 100%;" id="infoDatagrid">
        <thead frozen="true">
        <tr>
          <th data-options="field:'ck',checkbox:true,width:25"></th>
          <th data-options="field:'id',width:30,align:'center', sortable:true">ID</th>
          <th data-options="field:'name',width:150,align:'left',sortable:true">名称</th>
          <th data-options="field:'registerTime',width:200,align:'left',sortable:true,formatter:timeFormatter">注册时间</th>
        </tr>
      </table>
    </div>
  </div>
  <div id="editOrAddWin" class="easyui-dialog" data-options="iconCls:'icon-save'" closed="true"
       style="width: 900px;height:500px">
    <div style="padding:8px 30px 20px 30px">
      <form id="editForm">
        <div class="" style="display: none">
          <input class="easyui-textbox" type="text" id="hiddenId" name="id" style="display: none"/>
        </div>
        <div>
          <table style=" border-collapse:separate;border-spacing:10px;">
            <tr>
              <td>ID</td>
              <td><input class="easyui-textbox" id="editId" style="width: 160px;"></td>
              <td></td>
            </tr>
            <tr>
              <td>名称:</td>
              <td><input class="easyui-validatebox textbox" name="urlKey" id="editUrlKey"
                         missingMessage="输入名称" data-options="required:true" style="width:160px"/></td>
              <td></td>
              <%--</tr>--%>
              <%--<tr>--%>
              <td>资源地址:</td>
              <td><input class="easyui-validatebox textbox" name="resourceUrl" id="editResourceUrl"
                         missingMessage="输入地址" data-options="required:true" style="width:160px"/></td>
              <td></td>
            </tr>
            <tr>
              <td>资源类型:</td>
              <td><select class="easyui-combobox" name="resourceType" id="editResourceType"
                          missingMessage="选择类型" data-options="required:true" style="width:160px">
                <option value=1>图片</option>
                <option value=2>视频</option>
              </select></td>
              <td></td>
              <%--</tr>--%>
              <%--<tr>--%>
              <td>是否启用:</td>
              <td>
                <select style="width: 160px;" class="easyui-combobox" id="editStatus" type="text"
                        name="status"
                        missingMessage="选择是否启用" data-options="required:true">
                  <option value="0">停用</option>
                  <option value="1">启用</option>
                </select>
              </td>
              <td></td>
            </tr>
            <tr>
              <td>产品:</td>
              <td><input class="easyui-combobox" id="editProductCode" name="productCode"
                         missingMessage="选择产品" data-options="required:true" style="width:160px"/></td>
              <td></td>
              <%--</tr>--%>
              <%--<tr>--%>
              <td>渠道:</td>
              <td><input class="easyui-combobox" id="editDitchNo" name="ditchNo"
                         missingMessage="选择渠道" data-options="required:true" style="width:160px"/></td>
              <td></td>
            </tr>
            <tr>
              <td>省份:</td>
              <td><input class="easyui-combobox" id="editProvince" name="province"
                         missingMessage="选择省份" data-options="required:true" style="width:160px"/></td>
              <td></td>
              <%--</tr>--%>
              <%--<tr>--%>
              <td>排序:</td>
              <td><input class="easyui-validatebox textbox" id="editOrderPlace" name="orderPlace"
                         missingMessage="输入排序" data-options="required:true" style="width:160px"/></td>
              <td></td>
            </tr>
            <tr>
              <td>备注:</td>
              <td colspan="5"><input class="easyui-textbox" id="editRemark" name="remark"
                                     missingMessage="备注" data-options="required:false,multiline:true"
                                     style="width:450px;height: 50px;"/></td>
              <td></td>
            </tr>
          </table>
        </div>
      </form>
    </div>
  </div>
</div>


<script type="application/javascript">
  $(document).ready(loadProductResource(), loadProvinceResource(), loadDitchResource());
  $(document).ready(function () {
    $("#infoDatagrid").datagrid({
      url: 'qryList.json',
      iconCls: "",
      //fitColumns: true, //设置为true将自动使列适应表格宽度以防止出现水平滚动,false则自动匹配大小
      title: '栏目设置表',
      singleSelect: false,
      collapsible: false,
      fit: true,
      //toolbar设置表格顶部的工具栏,以数组形式设置
      rownumbers: true, //显示行号 1,2,3,4...
      idField: 'id', //标识列,一般设为id,可能会区分大小写,大家注意一下
      loadMsg: "正在努力为您加载数据", //加载数据时向用户展示的语句
      pagination: true, //显示最下端的分页工具栏
      pageSize: 10, //读取分页条数,即向后台读取数据时传过去的值
      pageList: [10, 20, 30], //可以调整每页显示的数据,即调整pageSize每次向后台请求数据时的数据
      sortName: "id", //初始化表格时依据的排序 字段 必须和数据库中的字段名称相同
      sortOrder: "desc",
      toolbar: [{//在dategrid表单的头部添加按钮
        text: "添加",
        iconCls: "icon-add",
        handler: function () {
          openAddWindow();
        }
      }, '-', {
        text: "删除",
        iconCls: "icon-remove",
        handler: function () {
          deleteInfoBatch();
        }
      }, '-', {
        text: "修改",
        iconCls: "icon-edit",
        handler: function () {
          openEditWindow();
        }
      }, '-', {
        text: "启用",
        iconCls: "icon-edit",
        handler: function () {
          setStatusBatch(1);
        }
      }, '-', {
        text: "停用",
        iconCls: "icon-edit",
        handler: function () {
          setStatusBatch(0);
        }
      }, '-', {
        text: "批量导出",
        iconCls: "icon-export",
        handler: function () {
          batchDownLoad();
        }
      }, '-', {
        text: "批量新增",
        iconCls: "icon-add",
        handler: function () {
          batchAdd();
        }
      }, '-', {
        text: "批量修改",
        iconCls: "icon-edit",
        handler: function () {
          batchUpdate();
        }
      }, '-'
      ]
    });
  });
</script>
</body>
</html>

